package collection;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * 集合属性的注入
 * @author Early
 *
 */
public class main {
	public static void main(String[] args){
		ApplicationContext ctx=new ClassPathXmlApplicationContext("ApplicationContext.xml");
		
		//引用内部集合bean
		Person person=(Person) ctx.getBean("person3");
		System.out.println(person);
		System.out.println("1======分======割======线======");
		
		NewPerson newperson=(NewPerson) ctx.getBean("newPerson");
		System.out.println(newperson);
		System.out.println("2======分======割======线======");
		
		DataSource dataSource=(DataSource) ctx.getBean("datasource");
		System.out.println(dataSource.getProperties());
		System.out.println("3======分======割======线======");
		
		//引用外部集合bean
		person=(Person) ctx.getBean("person4");
		System.out.println(person);
		System.out.println("4======分======割======线======");
		
		newperson=(NewPerson) ctx.getBean("newperson2");
		System.out.println(newperson);
		System.out.println("5======分======割======线======");
		
		dataSource=(DataSource) ctx.getBean("datasource1");
		System.out.println(dataSource.getProperties());
		System.out.println("6======分======割======线======");
		
		//引用外部集合，使用P命名空间进行赋值
		person=(Person) ctx.getBean("person5");
		System.out.println(person);
		System.out.println("7======分======割======线======");
		
		
		
	}
}
